module.exports = (grunt)->
  grunt.initConfig(
    pkg: grunt.file.readJSON 'package.json'
    concat:
      options:
        separator: ';'
      dist:
        src: ['src/**/*.js']
        dest: 'dist/<%= pkg.name%>.js'
    uglify:
      options:
        banner: '/*! <%=pkg.name%> <%=grunt.template.today("yyyy-mm-dd") %> */\n'
      dist:
        files:
          'dist/<%=pkg.name%>.min.js': ['<%= concat.dist.dest%>']
    qunit:
      files: ['test/**/*.html']

    jshint:
      files: ['src/**/*.js', 'test/**/*.js']
      options:
        globals:
          jQuery: true
          console: true
          module: true
    watch:
      files: ['<%=jshint.files%>']
      tasks: ['jshint']
    demo:
      options: {}
  )

  grunt.loadNpmTasks 'grunt-contrib-uglify'
  grunt.loadNpmTasks 'grunt-contrib-jshint'
  grunt.loadNpmTasks 'grunt-contrib-watch'
  grunt.loadNpmTasks 'grunt-contrib-concat'
  grunt.loadNpmTasks 'grunt-contrib-qunit'

  #  grunt.loadNpmTasks 'grunt-contrib-nodeunit'

  grunt.registerTask 'default', ['jshint', 'qunit', 'concat', 'uglify']
  grunt.registerTask 'test', ['jshint', 'qunit']
  grunt.registerTask 'demo', 'This is a test task', ()->
    grunt.log.write('Hello, world=>').ok()
